From: Daniel Colascione Date: Wed, 12 Dec 2012 03:26:52 +0000 (-0800) Subject: 2012-12-12 Daniel Colascione X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~3615^2~1366 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cc98b6842663b6fe30e0b7c7a628604959d5dc69;p=emacs.git 2012-12-12 Daniel Colascione * unexcw.c (fixup_executable): use posix_fallocate to ensure that the dumped Emacs is not a sparse file, greatly improving Cygwin "make bootstrap" performance. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3311f7c33a3..d19b7be7395 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-12 Daniel Colascione + + * unexcw.c (fixup_executable): use posix_fallocate to ensure that + the dumped Emacs is not a sparse file, greatly improving Cygwin + "make bootstrap" performance. + 2012-12-11 Michael Albinus * inotify.c (inotify_callback): Generate an Emacs event for every diff --git a/src/unexcw.c b/src/unexcw.c index 8c5d574530d..7d1a72e0009 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -183,6 +183,19 @@ fixup_executable (int fd) exe_header->file_optional_header.FileAlignment * exe_header->file_optional_header.FileAlignment; + /* Make sure the generated bootstrap binary isn't + * sparse. NT doesn't use a file cache for sparse + * executables, so if we bootstrap Emacs using a sparse + * bootstrap-emacs.exe, bootstrap takes about twenty + * times longer than it would otherwise. */ + + ret = posix_fallocate (fd, + ( exe_header->section_header[i].s_scnptr + + exe_header->section_header[i].s_size ), + 1); + + assert (ret != -1); + ret = lseek (fd, (long) (exe_header->section_header[i].s_scnptr +